home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 010a / dietdisc.zip / DIET.DOC < prev    next >
Text File  |  1991-02-10  |  6KB  |  153 lines

  1.  
  2.                             Diet Disk
  3.  
  4. Introduction
  5. ------------
  6.  
  7. Diet Disk is a program that helps you conserve space on your hard
  8. drive.  It is a TSR that intercepts DOS file activity and that allows
  9. applications to read and write compressed files.  The file compression
  10. is different from that used by ARC, LHARC, ZOO, or PKZIP.  You tell
  11. Diet Disk which files should be compressed by either (1) putting
  12. entries in a file named DIET.DIR or (2) by using the SLIM.EXE utility.
  13. The compression/decompression is performed "on-the-fly".  When an
  14. application reads a portion of a compressed file, Diet Disk gets the
  15. appropriate compressed segment(s) of the file, decompresses each
  16. segment, and hands the result to the application.  When the application
  17. writes a portion of the file, Diet Disk compresses the data into one
  18. or more segments and writes the compressed data to the disk.  The
  19. amount of compression varies; some files compress better than others.
  20. Typical compression is about 50%.
  21.  
  22. Diet Disk is Public Domain software.  Support for Diet Disk is
  23. available on BIX, in the IBM.Utils conference, Comments topic.
  24.  
  25.  
  26. Can I Trust Diet Disk?
  27. ----------------------
  28.  
  29. Make a copy of the file (or files) you typically work with.  Load
  30. Diet Disk and use SLIM to compress the copy(ies).  Run your
  31. application on the copy(ies).  Do all the things you would typically
  32. do in your application, including saving the data to disk.  Exit your
  33. application and use FATTEN to decompress the file(s).  Run your
  34. application again; make sure the data is intact and that your
  35. application behaves normally.  If Diet Disk passes this test, it's
  36. probably okay to use Diet Disk on a regular basis.  Be aware, though,
  37. that I can't personally test Diet Disk with every single DOS
  38. application ever written.  And, since Diet Disk is free, please
  39. don't come after me if you think it has malfunctioned.  If you're
  40. really worried, get a larger hard drive.
  41.  
  42.  
  43. Requirements
  44. ------------
  45.  
  46. Diet Disk requires a PC, PS/2, or compatible with a hard drive and
  47. PC/DOS 2.0 or later.
  48.  
  49.  
  50. Installation
  51. ------------
  52.  
  53. Copy the files into a directory named in your DOS PATH statement, or
  54. make a separate directory and change your PATH statement to include
  55. the new directory.
  56.  
  57.  
  58. Usage
  59. -----
  60.  
  61. Here are the pieces that make up Diet Disk and how to use them:
  62.  
  63.     DietDisk.Com -- This is the TSR component of Diet Disk.  It
  64.     takes up about 24K of RAM.  You'll probably want to run it
  65.     by putting entries in your Autoexec.Bat file.  Here's an
  66.     example:
  67.  
  68.          <other Autoexec.Bat statements>
  69.          C:
  70.          CD \DIET
  71.          DIETDISK
  72.          CD \
  73.          <more Autoexec.Bat statements>
  74.  
  75.     If you try to use your application on compressed files and 
  76.     DietDisk.Com isn't loaded, your application won't work right.
  77.     DietDisk.Com can be "loaded high" by QEMM or 386^Max, if you 
  78.     want.  
  79.  
  80.     Diet.Dir -- A simple text file, Diet.Dir contains entries
  81.     made up of drive:\path\filespec information.  The filespec
  82.     can contain wildcards (the "*" and "?" characters).  When
  83.     a file is created or completely rewritten by an
  84.     application, Diet Disk looks in this file for a matching
  85.     entry.  If found, Diet Disk makes the file compressed.  Put
  86.     the Diet.Dir file in the SAME directory as DietDisk.Com and
  87.     make that directory CURRENT when you invoke DietDisk.Com.
  88.     DietDisk.Com always looks in its startup directory for the
  89.     Diet.Dir file.
  90.  
  91.     Slim.Exe -- Use SLIM to compress existing files.  Use it
  92.     like this: SLIM <filespec>.
  93.  
  94.     Fatten.Exe -- Use FATTEN to decompress files you no longer
  95.     want compressed.  Use it like this: FATTEN <filespec>.
  96.  
  97.     DietInfo.Exe -- Use DIETINFO to find out which files are
  98.     compressed, and by how much.  Use: DIETINFO <filespec>.
  99.  
  100.     DietOff.Exe -- Normally, a file is decompressed as it's read.
  101.     You can turn this off with DIETOFF.  Why?  You might want
  102.     files to remain compressed when you do backups of your disk
  103.     or when doing file transfers through your modem.  (Make sure
  104.     the receiver of the file has a copy of Diet Disk!)
  105.  
  106.     DietOn.Exe -- Turns Diet Disk back on.  Harmless if it's on
  107.     already.
  108.  
  109.     DietChk.Exe -- Use DIETCHK to verify the integrity of your
  110.     compressed files.  Use: DIETCHK <filespec>.  DIETCHK makes
  111.     sure each compressed file conforms to the following file
  112.     layout.
  113.  
  114.  
  115. How It Works
  116. ------------
  117.  
  118. A file compressed by Diet Disk has the following format:
  119.  
  120.     Control Record (1 per file, at the beginning)
  121.          - 6 bytes...Diet Disk footprint
  122.          - 4 bytes..."virtual" file length data
  123.          - 6 bytes...reserved filler
  124.  
  125.     Pointer Record (first one follows the Control Record)
  126.          - 4 bytes...file location of the next Pointer Record
  127.          - 4 bytes...the location of the previous Pointer Record
  128.          - 8 bytes...reserved filler
  129.          - 250 pairs of location/length data
  130.               - 4 bytes...file location
  131.               - 2 bytes...length
  132.  
  133.     Compressed Data Segments (up to 250, following the Pointer Record)
  134.          - 4 bytes...file location of the overflow segment
  135.          - 2 bytes...length of the overflow segment
  136.          - Compressed data
  137.  
  138.     Other Pointer Records and Compressed Data Segments, as necessary.
  139.  
  140.  
  141. DietDisk.Com intercepts DOS file activity, both for file handles
  142. and FCBs.  When an application seeks into a file and reads a certain
  143. number of bytes, DietDisk.Com calculates the segment(s) it needs,
  144. reads the segments, decompresses them, and puts the result into
  145. the application's read buffer.  When an application writes data,
  146. DietDisk.Com organizes the data into 2K segments, compresses each
  147. segment, and writes the compressed data into the file.  Updates to
  148. the Control Record and the appropriate Pointer Record occur as
  149. needed.  For more details, see the source code.
  150.  
  151.  
  152.  
  153.